home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 718 b | 49 lines | [TEXT/CWIE] |
- // Delayer.h
-
- #ifndef Delayer_h
- #define Delayer_h
-
- #ifndef Heap_h
- #include "Heap.h"
- #endif
- #ifndef HeapLink_h
- #include "HeapLink.h"
- #endif
- #ifndef Postponer_h
- #include "Postponer.h"
- #endif
- #ifndef Tick_h
- #include "Tick.h"
- #endif
-
- class Delayer
- {
- private:
- HeapLink<Delayer> delayLink;
- Postponer postponer;
- Tick when;
-
- static Heap<Delayer>& Waiting();
-
- public:
- Delayer( const Method& );
- ~Delayer();
-
- bool Pending() const;
- void DelayBy( uint32 time );
- void DelayTo( Tick );
-
- void Cancel();
- void Hasten();
- void Flush();
-
- Tick ScheduledTime() const { return when; }
-
- static void ScheduleTasks();
- static uint32 SleepTime();
-
- bool Before( const Delayer& ) const;
- };
-
- #endif
-